﻿using UnityEngine;
using System.Collections;

public class Hero : MonoBehaviour {

	public float speed = 0.01f;

	void Update () {
		if(!GameSetting.GAME_START)
			return;
		transform.position = new Vector3(transform.position.x + speed,transform.position.y,transform.position.z);
	}

	void OnCollisionEnter2D(Collision2D c2d){
		if(c2d.transform.tag == "Border"){
			GetComponent<Rigidbody2D>().isKinematic = true;
		}else if (c2d.transform.tag == "Player"){
			Debug.Log("Open Fighting System.");
			GameSetting.GAME_START = false;
		}
	}

}
